{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Robodyno 命令行工具介绍\n",
    "\n",
    "> **注:** 以下在jupyter中运行命令行命令，需在命令前添加 `!` , 若在`终端`或`PowerShell`中运行下面命令则不需要添加。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## robodyno 命令"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno [OPTIONS] COMMAND [ARGS]...\n",
      "\n",
      "  Robodyno command line interface.\n",
      "\n",
      "Options:\n",
      "  --version               Show the version and exit.\n",
      "  -c, --can-bus TEXT      CAN bus interface channel.\n",
      "  -b, --baudrate INTEGER  CAN bus baud rate.\n",
      "  --help                  Show this message and exit.\n",
      "\n",
      "Commands:\n",
      "  list     List all devices on the CAN bus.\n",
      "  monitor  Monitor all devices on the CAN bus.\n",
      "  motor    Motor commands.\n"
     ]
    }
   ],
   "source": [
    "! robodyno --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 查看版本"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "robodyno, version 1.7.1\n"
     ]
    }
   ],
   "source": [
    "! robodyno --version"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.robodyno list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno list [OPTIONS]\n",
      "\n",
      "  List all devices on the CAN bus.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno list --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 查询当前can总线上的设备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1m  ID\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mModel               \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mVersion\u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x11\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01A    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m1.1    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x12\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02A(12)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x13\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02B(66)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x14\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02A(15)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x15\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01A    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0.3    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x16\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01B    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0.3    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x17\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01B    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m1.1    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x18\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02B(44)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "└──────┴──────────────────────┴─────────┘\n"
     ]
    }
   ],
   "source": [
    "! robodyno list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 查询can0总线上的设备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1m  ID\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mModel               \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mVersion\u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x11\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01A    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m1.1    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x12\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02A(12)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x13\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02B(66)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x14\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02A(15)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x15\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01A    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0.3    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x16\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01B    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0.3    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x17\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01B    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m1.1    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x18\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02B(44)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "└──────┴──────────────────────┴─────────┘\n"
     ]
    }
   ],
   "source": [
    "! robodyno -c can0 list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 查询波特率为1M的总线上的设备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1m  ID\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mModel               \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mVersion\u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x11\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01A    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m1.1    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x12\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02A(12)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x13\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02B(66)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x14\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02A(15)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x15\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01A    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0.3    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x16\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01B    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0.3    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x17\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_01B    \u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m1.1    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36m0x18\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mROBODYNO_PRO_02B(44)\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m2.0    \u001b[0m\u001b[33m \u001b[0m│\n",
      "└──────┴──────────────────────┴─────────┘\n"
     ]
    }
   ],
   "source": [
    "! robodyno -b 1000000 list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.robodyno monitor"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno monitor [OPTIONS]\n",
      "\n",
      "  Monitor all devices on the CAN bus.\n",
      "\n",
      "Options:\n",
      "  -g, --group  Group messages by CAN ID.\n",
      "  --help       Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno monitor --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 监控CAN总线上的所有设备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Press Ctrl+C to exit.\n",
      "\u001b[32m[\u001b[0m\u001b[32m1705.0\u001b[0m\u001b[32m.\u001b[0m\u001b[32m978\u001b[0m\u001b[32m]\u001b[0m \u001b[36m0x11\u001b[0m | \u001b[35m0x02\u001b[0m \u001b[33m[\u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m]\u001b[0m\n",
      "\u001b[32m[\u001b[0m\u001b[32m1705.0\u001b[0m\u001b[32m.\u001b[0m\u001b[32m978\u001b[0m\u001b[32m]\u001b[0m \u001b[36m0x11\u001b[0m | \u001b[35m0x02\u001b[0m \u001b[33m[\u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m]\u001b[0m\n",
      "\u001b[32m[\u001b[0m\u001b[32m1705.0\u001b[0m\u001b[32m.\u001b[0m\u001b[32m978\u001b[0m\u001b[32m]\u001b[0m \u001b[36m0x11\u001b[0m | \u001b[35m0x02\u001b[0m \u001b[33m[\u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m]\u001b[0m\n",
      "\u001b[32m[\u001b[0m\u001b[32m1705.0\u001b[0m\u001b[32m.\u001b[0m\u001b[32m978\u001b[0m\u001b[32m]\u001b[0m \u001b[36m0x11\u001b[0m | \u001b[35m0x02\u001b[0m \u001b[33m[\u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x00\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x02\u001b[0m\u001b[33m \u001b[0m\u001b[33m0x01\u001b[0m\u001b[33m]\u001b[0m\n",
      "^C\n"
     ]
    }
   ],
   "source": [
    "! robodyno monitor"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 通过ID分组监控设备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Press Ctrl+C to exit.\n",
      "\u001b[?25l┏━━━━━━━━━━━┳━━━━┳━━━━━━━━━┳━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1mTimestamp\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mID\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mCommand\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mData\u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━━━━━━╇━━━━╇━━━━━━━━━╇━━━━━━┩\n",
      "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K┏━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1mTimestamp \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m ID \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mCommand\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mData                                   \u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
      "│\u001b[32m \u001b[0m\u001b[32m1684.0.917\u001b[0m\u001b[32m \u001b[0m│\u001b[36m \u001b[0m\u001b[36m0x10\u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m 0x02  \u001b[0m\u001b[35m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0x01 0x00 0x00 0x00 0x00 0x03 0x03 0x00\u001b[0m\u001b[33m \u001b[0m│\n",
      "└────────────┴──────┴─────────┴─────────────────────────────────────────┘^C\n",
      "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K┏━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1mTimestamp \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m ID \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mCommand\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mData                                   \u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
      "│\u001b[32m \u001b[0m\u001b[32m1684.0.917\u001b[0m\u001b[32m \u001b[0m│\u001b[36m \u001b[0m\u001b[36m0x10\u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m 0x02  \u001b[0m\u001b[35m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m0x01 0x00 0x00 0x00 0x00 0x03 0x03 0x00\u001b[0m\u001b[33m \u001b[0m│\n",
      "└────────────┴──────┴─────────┴─────────────────────────────────────────┘\n",
      "\u001b[?25h"
     ]
    }
   ],
   "source": [
    "! robodyno monitor -g"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.robodyno motor"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor [OPTIONS] COMMAND [ARGS]...\n",
      "\n",
      "  Motor commands.\n",
      "\n",
      "Options:\n",
      "  -i, --id DEVICE_ID_LIST  Device ID list.\n",
      "  --help                   Show this message and exit.\n",
      "\n",
      "Commands:\n",
      "  calibrate     Calibrate motor.\n",
      "  clear-errors  Clear errors on motors.\n",
      "  config        Configure motor parameters.\n",
      "  disable       Disable motor.\n",
      "  enable        Enable motor.\n",
      "  estop         Emergency stop motors.\n",
      "  info          Get motor info.\n",
      "  init          Initialize motor.\n",
      "  pos           Set motor position.\n",
      "  reboot        Reboot motors.\n",
      "  reset         Reset motors.\n",
      "  torque        Set motor torque.\n",
      "  vel           Set motor velocity.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.1.robodyno motor info"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Device \u001b[1;36m0x10\u001b[0m not found.\n",
      "Usage: robodyno motor info [OPTIONS]\n",
      "\n",
      "  Get motor info.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor info --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 查询0x10电机详细信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1m       \u001b[0m\u001b[1;36m[0x11]\u001b[0m\u001b[1m \u001b[0m\u001b[1;32mROBODYNO_PRO_01A(12)\u001b[0m\u001b[1m \u001b[0m\u001b[1;33m1.1\u001b[0m\u001b[1m       \u001b[0m\n",
      "┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1mProperty         \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m        Value\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     \u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━┩\n",
      "│\u001b[36m \u001b[0m\u001b[36mState            \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m     DISABLED\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m     \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mError            \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m         \u001b[0m\u001b[32mNONE\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m     \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mMode             \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mPOSITION_MODE\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m     \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mVoltage          \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m        12.06\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mV    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mTemperature      \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m        33.93\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m℃    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mPosition         \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m       0.1755\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mrad  \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mAbsolute Position\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m   -1975.6214\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mrad  \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mVelocity         \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m       0.0000\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mrad/s\u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mTorque           \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m       0.0000\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mN*m  \u001b[0m\u001b[33m \u001b[0m│\n",
      "└───────────────────┴───────────────┴───────┘\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor -i 0x11 info"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 查询多个电机的详细信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Device \u001b[1;36m0x10\u001b[0m not found.\n",
      "Device \u001b[1;36m0x12\u001b[0m not found.\n",
      "Device \u001b[1;36m0x13\u001b[0m not found.\n",
      "Device \u001b[1;36m0x14\u001b[0m not found.\n",
      "Device \u001b[1;36m0x15\u001b[0m not found.\n",
      "\u001b[1m       \u001b[0m\u001b[1;36m[0x11]\u001b[0m\u001b[1m \u001b[0m\u001b[1;32mROBODYNO_PRO_01A(12)\u001b[0m\u001b[1m \u001b[0m\u001b[1;33m1.1\u001b[0m\u001b[1m       \u001b[0m\n",
      "┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━┓\n",
      "┃\u001b[1m \u001b[0m\u001b[1mProperty         \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m        Value\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     \u001b[0m\u001b[1m \u001b[0m┃\n",
      "┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━┩\n",
      "│\u001b[36m \u001b[0m\u001b[36mState            \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m     DISABLED\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m     \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mError            \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m         \u001b[0m\u001b[32mNONE\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m     \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mMode             \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32mPOSITION_MODE\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m     \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mVoltage          \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m        12.27\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mV    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mTemperature      \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m        35.99\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m℃    \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mPosition         \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m       0.1755\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mrad  \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mAbsolute Position\u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m   -1975.6214\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mrad  \u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mVelocity         \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m       0.0000\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mrad/s\u001b[0m\u001b[33m \u001b[0m│\n",
      "│\u001b[36m \u001b[0m\u001b[36mTorque           \u001b[0m\u001b[36m \u001b[0m│\u001b[32m \u001b[0m\u001b[32m       0.0000\u001b[0m\u001b[32m \u001b[0m│\u001b[33m \u001b[0m\u001b[33mN*m  \u001b[0m\u001b[33m \u001b[0m│\n",
      "└───────────────────┴───────────────┴───────┘\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor -i 0x10,0x11,0x12-0x15 info"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2.robodyno motor enable"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor enable [OPTIONS]\n",
      "\n",
      "  Enable motor.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor enable --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 使能0x10电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 enable"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 使能多个电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10,0x11,0x12-0x15 enable"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.robodyno motor disable"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor disable [OPTIONS]\n",
      "\n",
      "  Disable motor.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor disable --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 失能0x10电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 disable"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 失能多个电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10,0x11,0x12-0x15 disable"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4.robodyno motor clear-errors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor clear-errors [OPTIONS]\n",
      "\n",
      "  Clear errors on motors.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor clear-errors --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 清除0x10电机错误"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 clear-errors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 清除多个电机错误"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10,0x11,0x12-0x15 clear-errors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.5.robodyno motor estop"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor estop [OPTIONS]\n",
      "\n",
      "  Emergency stop motors.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor estop --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 软急停0x10电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 estop"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 软急停多个电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10,0x11,0x12-0x15 estop"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.6.robodyno motor init"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor init [OPTIONS]\n",
      "\n",
      "  Initialize motor.\n",
      "\n",
      "Options:\n",
      "  -p, --pos FLOAT          Initial position.\n",
      "  -a, --absolute           Use absolute position.\n",
      "  --save / -S, --not-save  Save the absolute initial position.\n",
      "  --help                   Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor init --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 初始化0x10电机位置"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 init -p 0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 初始化0x10电机绝对位置并保存"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 init -aS"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 初始化多个电机位置"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Absolute position is not supported on firmware version \u001b[1;36m0.3\u001b[0m.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor -i 0x10,0x11,0x12-0x15 init -p 0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.7.robodyno motor pos"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor pos [OPTIONS] POSITION\n",
      "\n",
      "  Set motor position.\n",
      "\n",
      "Options:\n",
      "  -m, --mode [direct|filter|track]\n",
      "                                  Position control mode. Default is filter\n",
      "                                  mode.\n",
      "  -b, --bandwidth FLOAT           Bandwidth of the filter.\n",
      "  -v, --traj-vel FLOAT            Trajectory velocity of the position tracking\n",
      "                                  control.\n",
      "  --traj-acc, --acc FLOAT         Trajectory acceleration of the position\n",
      "                                  tracking control.\n",
      "  --traj-dec, --dec FLOAT         Trajectory deceleration of the position\n",
      "                                  tracking control.\n",
      "  --vel-ff FLOAT                  Velocity feedforward.\n",
      "  --torque-ff FLOAT               Torque feedforward.\n",
      "  -a, --absolute                  Use absolute position.\n",
      "  --help                          Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor pos --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 直接位置运动"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 0x10电机在直接位置模式下运动到1.57rad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 pos -m direct -- 1.57"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 滤波位置运动"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 0x10电机在滤波位置模式下运动到-1.57rad，控制频率8hz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 pos -m filter -b 8 -- -1.57"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 轨迹位置运动"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 0x10电机在轨迹位置模式下运动到3，14rad，最大速度0.2rad/s,加速度0.5rad/s^2,减速度0.1rad/s^2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 pos -m track -v 0.2 --acc 0.5 --dec 0.1 -- 3.14"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 绝对位置运动"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 0x10电机在滤波位置模式下绝对位置运动到0rad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 pos -a -- 0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.8.robodyno motor vel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor vel [OPTIONS] VELOCITY\n",
      "\n",
      "  Set motor velocity.\n",
      "\n",
      "Options:\n",
      "  -m, --mode [direct|ramp]  Velocity control mode. Default is ramp mode.\n",
      "  -r, --ramp FLOAT          Ramp rate of the velocity ramp control.\n",
      "  --torque-ff FLOAT         Torque feedforward.\n",
      "  --help                    Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor vel --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 直接速度运动"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 0x10电机在直接速度模式下以0.5rad/s运动"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 vel -m direct -- 0.5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 匀加减速运动"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 0x10电机在匀加减速模式下以-1.57rad速度运动，运动的加速度为0.5(rad/s^2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 vel -m ramp -r 0.5 -- -1.57"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.9.robodyno motor torque"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor torque [OPTIONS] TORQUE\n",
      "\n",
      "  Set motor torque.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor torque --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 力矩模式运动"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 0x10电机在力矩模式下给到0.03Nm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 torque -- 0.03"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.10.robodyno motor reboot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor reboot [OPTIONS]\n",
      "\n",
      "  Reboot motors.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor reboot --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 重启0x10电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10 reboot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 重启多个电机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "! robodyno motor -i 0x10,0x11,0x12-0x15 reboot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.11.robodyno motor config"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **注:** `config`命令需在`终端`或`PowerShell`中运行"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor config [OPTIONS]\n",
      "\n",
      "  Configure motor parameters.\n",
      "\n",
      "Options:\n",
      "  -v, --vel-limit       Set velocity limit.\n",
      "  -c, --current-limit   Set current limit.\n",
      "  -p, --pid             Set PID gains.\n",
      "  -h, --heartbeat-rate  Set heartbeat rate.\n",
      "  -i, --new-id          Set new ID.\n",
      "  -b, --can-baudrate    Set CAN baudrate.\n",
      "  --help                Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor config --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.12.robodyno motor calibrate"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **注:** `calibrate`命令需在`终端`或`PowerShell`中运行"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor calibrate [OPTIONS]\n",
      "\n",
      "  Calibrate motor.\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor calibrate --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "#### 3.13.robodyno motor reset"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **注:** `reset`命令需在`终端`或`PowerShell`中运行"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 显示帮助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: robodyno motor reset [OPTIONS]\n",
      "\n",
      "Options:\n",
      "  --help  Show this message and exit.\n"
     ]
    }
   ],
   "source": [
    "! robodyno motor reset --help"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
